vtgateproxy v19 buildable and passing tests#594
Conversation
Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
| if strings.HasPrefix(sql, "use ") { | ||
| targetString := sqlescape.UnescapeID(sql[4:]) | ||
| targetString, err := sqlescape.UnescapeID(sql[4:]) | ||
| if err != nil { |
There was a problem hiding this comment.
Somewhat minor question but actually a bit thought provoking as well...
Suppose this parsing fails for whatever reason. Is it better to fail (as you did here) or just fall through and call session.Execute below? Since the whole point of this use statement hijacking is to avoid a round trip, if for some rare reason vtgate is able to process it but the proxy isn't then could we be unnecesarily failing?
Then again maybe the case where we can't unescape an ID is rare enough that it's just plain irrelevant?
@henryr curious about your thoughts as well.
There was a problem hiding this comment.
I think it's ok to fail. I think it's just as likely that we create a dependency elsewhere in the proxy where we assume that we've always successfully intercepted use statements, as a situation arises where we can't unescape the argument.
* get v19 to build (WIP) * sort of builds? * misnamed flag * flag name * remove binary Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * update go-mysql-driver Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * return ErrNoSubConnAvailable for no available connections Signed-off-by: Esme Lamb <dlamb@slack-corp.com> --------- Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
* get v19 to build (WIP) * sort of builds? * misnamed flag * flag name * remove binary Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * update go-mysql-driver Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * return ErrNoSubConnAvailable for no available connections Signed-off-by: Esme Lamb <dlamb@slack-corp.com> --------- Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
* get v19 to build (WIP) * sort of builds? * misnamed flag * flag name * remove binary Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * update go-mysql-driver Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * return ErrNoSubConnAvailable for no available connections Signed-off-by: Esme Lamb <dlamb@slack-corp.com> --------- Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
* get v19 to build (WIP) * sort of builds? * misnamed flag * flag name * remove binary Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * update go-mysql-driver Signed-off-by: Esme Lamb <dlamb@slack-corp.com> * return ErrNoSubConnAvailable for no available connections Signed-off-by: Esme Lamb <dlamb@slack-corp.com> --------- Signed-off-by: Esme Lamb <dlamb@slack-corp.com>
Description
vtgateproxy-v19branch was created by cherry-picking the commits fromvtgateproxy-15onto the end ofslack-19.0vtgateproxybinary to build and pass e2e testschanges from 15 to 19 were more substantial than 14 to 15
mysql.Handlerinterfacemysql.NewListeneras flags with default valuessqlescape.UnescapeIDErrNoSubConnAvailableinstead of "no available connections" when first_ready builder is called with an empty map, this causes grpc to retry until a conn becomes ready. Otherwise fail fast logic is causing us to fail a bit too fast, something changed in this behaviour from grpc 1.45 (v15) to 1.62 (v19)